export default{
    //rootGetters可以获取根目录index.js中的state信息
    requests(state,_,_2,rootGetters)
    {
        const coachId = rootGetters.userId;
        return state.requests.filter(
            req=>req.coachId === coachId
        );
    },
    //hasRequests(state,getters)
    hasRequests(_,getters){
        return getters.requests && getters.requests.length >0;
    }
};